#!/usr/bin/ksh

# Script name: trapsig2.ksh

integer num

exec 2> /dev/null
trap 'print "You did not enter an integer."' ERR

while ((1))
do
	print -n "Enter any number (-1 to exit): "
	read num
	status=$?
	if ((num==-1))
	then
		break
	elif ((status == 0 ))
	then
		print "Square of $num is $((num*num)). \n"
	fi
done
print "Exitting normally"


